﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DepInnerRepTask.aspx.cs"
    Inherits="Ultimus.Web.DepInnerRepTask" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="CSS/style.css" rel="stylesheet" rev="stylesheet" />
    <link href="CSS/global.css" rel="stylesheet" rev="stylesheet" />
    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <style type="text/css">
       table
        {
            border-collapse: collapse; /* 关键属性：合并表格内外边框(其实表格边框有2px，外面1px，里面还有1px哦) */
            border: solid #999; /* 设置边框属性；样式(solid=实线)、颜色(#999=灰) */
            border-width: 1px 0 0 1px; /* 设置边框状粗细：上 右 下 左 = 对应：1px 0 0 1px */
         font-size:12px;
        }
      /* table th, table td
        {
            border: solid #999;
            border-width: 0 1px 1px 0;
            padding: 2px;
        }
        tfoot td
        {
            text-align: center;
        }*/
      
    </style>
    <script type="text/javascript">
    
        function CheckFile(s) {
            if (s == 1) {
                var file = document.getElementById("FileUpload1").value;
                if (file == "") {
                    alert("请选择附件！");
                    return false;
                }
            }
            else {
                var file = document.getElementById("FileUpload2").value;
                if (file == "") {
                    alert("请选择附件！");
                    return false;
                }
            }
        }
        function CheckNull(flag) {
            if (flag == 1) {
                var RepContent = document.getElementById("txtrep").value;
               // var content = document.getElementById('txtrep').value;
                var ss = RepContent.indexOf("☆");
                if (ss >= 0) {
                    alert("回复内容不能包含特殊字符☆！");
                    return false;
                }
                if (RepContent == "") {
                    alert("回复内容不能为空！");
                    document.getElementById("txtrep").focus();
                    return false;
                }
            }
            else if (flag == 2) {
                var closeName = document.getElementById("txtCloseName").value;
                var closeTime = document.getElementById("txtCloseTime").value;
                var closeDes = document.getElementById("txtCloseDes").value;
                if (closeName == "") {
                    alert("关闭人不能为空！");
                    document.getElementById("txtCloseName").focus();
                    return false;
                }
                if (closeTime == "") {
                    alert("关闭时间不能为空！");
                    document.getElementById("txtCloseTime").focus();
                    return false;
                } 
                if (closeDes == "") {
                    alert("关闭人最终意见不能为空！");
                    document.getElementById("txtCloseDes").focus();
                    return false;
                }
            }
            else if (flag == 3) {
                var txtAddUsers = document.getElementById("txtAddUsers").value;
                if (txtAddUsers == "") {
                    alert("新增处理人不能为空！");
                    document.getElementById("txtAddUsers").focus();
                    return false;
                }
            }
        }
      
//        function ISClose() { 
//        if(confirm('您是否要打开办公流程平台中的相关任务？')
//        {
//        window.location.href="login.aspx";//测试
//        }

//        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="font-size: 12px; width: 700px;" class="listTable3">
            <tr>
                <td style="font-size: 15px; color:Blue;">
                    部内工单
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    工单编号：<span style="color: Red;">*</span><asp:TextBox ID="txtNo" runat="server" MaxLength="20"></asp:TextBox>
                </td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 工单标题：<span style="color: Red;">*</span>
                    <asp:TextBox ID="txtTitile" runat="server" MaxLength="20"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp; 处理人：<span style="color: Red;">*</span>
                    <asp:TextBox ID="txtRepUsers" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp; 抄送人：&nbsp;&nbsp;
                    <asp:TextBox ID="txtCopyToUsers" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    通知渠道：<asp:CheckBox ID="chkMess" runat="server" Text="短信" />
                    <asp:CheckBox ID="chkEmail" runat="server" Text="外网邮件" />
                </td>
                <td>
                    要求回复时间：&nbsp;
                    <asp:TextBox ID="txtRepDate" runat="server" onClick="WdatePicker()"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp; 发起人：<span style="color: Red;">*</span>
                    <asp:TextBox ID="txtFaqi" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 发起时间：<span style="color: Red;">*</span>
                    <asp:TextBox ID="txtFaDate" runat="server" onClick="WdatePicker()"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    消息内容：&nbsp;
                    <asp:TextBox ID="txtMess" runat="server" Height="46px" TextMode="MultiLine" Width="266px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    任务描述：<span style="color: Red;">*</span><asp:TextBox ID="txtTaskDes" runat="server"
                        Height="46px" MaxLength="1000" TextMode="MultiLine" Width="266px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 附件：
                    <asp:FileUpload ID="file" runat="server" />
                </td>
                <td>
                    <asp:Button ID="btnUpload" class="btnBg" runat="server" Text="上传附件" OnClick="btnUpload_Click" OnClientClick="return CheckFile();" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvUpLoadFile" runat="server" OnRowDataBound="gvUpLoadFile_RowDataBound"
                        DataKeyNames="UPLOAD_FILE_ID" OnRowDeleting="gvUpLoadFile_RowDeleting" Width="600px"
                        AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="UPLOAD_FILE_ID" Visible="False" />
                            <asp:BoundField DataField="FILE_NAME" HeaderText="文件名称" />
                            <asp:BoundField DataField="UPLOAD_BY" HeaderText="上传人" />
                            <asp:BoundField DataField="UPLOAD_DATE" HeaderText="上传时间" />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="font-size: 15px; color:Blue;">
                    处理信息（共有<asp:Label ID="lblCount" runat="server" Text="0"></asp:Label>个回复）
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                 <table style="font-size: 12px; width: 680px;">
                <tr><th width="80px">回复人</th><th width="100px">回复时间</th><th>回复内容</th><th>附件</th><th width="30px">修改</th><th width="30px">删除</th></tr>
                     <asp:Repeater ID="RepList" runat="server" 
                        onitemdatabound="RepList_ItemDataBound">
                       
                        <ItemTemplate>
                            <tr>
                          
                                <td width="80px">
                                    <%# Eval("CREATE_BY ")%>  
                                </td>
                                <td width="100px">
                                    <%# Eval("REPLY_DATE")%>
                                </td>
                                 
                                <td>
                                    <asp:Label ID="lblContent" runat="server" Text="Label"></asp:Label>
                                </td>
                                 
                                <td>
                              
                                   <asp:LinkButton  ID="lbtnFile" runat="server" CommandArgument='<%# Eval("REPLY_ID")%> ' OnClick="lbtnFile_Click"></asp:LinkButton>
                                </td>
                                <td width="30px">
                                 <asp:LinkButton ID="lbtnUpComment" CommandArgument='<%# Eval("REPLY_ID")%> ' runat="server" OnClick="lbtnUpComment_Click">修改</asp:LinkButton>     
                                  
                                </td >
                                <td width="30px">
                                  <asp:LinkButton ID="lbtnDelComment" CommandArgument='<%# Eval("REPLY_ID")%> ' runat="server" OnClick="lbtnDelComment_Click">删除</asp:LinkButton>     
                                  
                                </td>
                            </tr>
                        </ItemTemplate>
                        
                    </asp:Repeater>
                    <tr>
                     <td>
                        <asp:Label ID="lblPageRecord" runat="server" Text=""></asp:Label>
                    </td>
                    <td colspan="3" style="width:600px">
                        <asp:Button ID="btnFirstPage" runat="server" class="btnBg" Text="首页" OnClick="FirstPage_Click" />
                        <asp:Button ID="btnUpPage" runat="server" class="btnBg" Text="上页" OnClick="UpPage_Click" />
                        <asp:Button ID="btnDownPage" runat="server" class="btnBg" Text="下页" OnClick="DownPage_Click" />
                        <asp:Button ID="btnLastPage" runat="server" class="btnBg" Text="末页" OnClick="LastPage_Click" />
                    </td></tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="font-size: 15px; color:Blue;">
                    发表回复
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    回复内容：<asp:TextBox ID="txtrep" runat="server" Height="52px" TextMode="MultiLine" Width="287px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    回复附件：
                    <asp:FileUpload ID="FileUpload1" runat="server" />
                </td>
                <td>
                    <asp:Button ID="btnUpRep" runat="server" class="btnBg" Text="上传附件" OnClientClick="return CheckFile(1);"
                        OnClick="btnUpRep_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvRepList" runat="server" OnRowDataBound="gvRepList_RowDataBound"
                        DataKeyNames="UPLOAD_FILE_ID" OnRowDeleting="gvRepList_RowDeleting" Width="600px"
                        AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="UPLOAD_FILE_ID" Visible="False" />
                            <asp:BoundField DataField="FILE_NAME" HeaderText="文件名称" />
                            <asp:BoundField DataField="UPLOAD_BY" HeaderText="上传人" />
                            <asp:BoundField DataField="UPLOAD_DATE" HeaderText="上传时间" />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="btnRep" class="btnBg" runat="server" Text="发表" OnClick="btnRep_Click"  OnClientClick="return CheckNull(1);"/>
                     <asp:Button ID="btnUpdateRep" runat="server" Text="确定修改"  class="btnBg"
                        OnClientClick="return CheckNull(1);" onclick="btnUpdateRep_Click"/>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <table runat="server" id="MyTable" style="font-size: 12px; width: 700px;"
            class="listTable3">
            <tr>
                <td style="font-size: 15px; color:Blue;">
                    关闭工单
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    关闭人：<asp:TextBox ID="txtCloseName" runat="server"></asp:TextBox>
                </td>
                <td>
                    关闭时间：<asp:TextBox ID="txtCloseTime" runat="server" onClick="WdatePicker()"></asp:TextBox>
                </td>
            </tr>
        <%--    <tr>
                <td>
                    关闭类型：<asp:DropDownList ID="drpCloseType" runat="server">
                        <asp:ListItem Value="0">用户人工关闭</asp:ListItem>
                        <asp:ListItem Value="1">系统自动终止</asp:ListItem>
                      
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>--%>
            <tr>
                <td>
                    最终意见：<asp:TextBox ID="txtCloseDes" runat="server" Height="52px" TextMode="MultiLine"
                        Width="287px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    附件：
                    <asp:FileUpload ID="FileUpload2" runat="server" />
                </td>
                <td>
                    <asp:Button ID="btnUpCloseFile" runat="server" Text="上传附件" OnClientClick="return CheckFile(2);"
                        OnClick="btnUpCloseFile_Click"  class="btnBg"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvCloseList" runat="server" OnRowDataBound="gvCloseList_RowDataBound"
                        DataKeyNames="UPLOAD_FILE_ID" OnRowDeleting="gvCloseList_RowDeleting" Width="600px"
                        AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="UPLOAD_FILE_ID" Visible="False" />
                            <asp:BoundField DataField="FILE_NAME" HeaderText="文件名称" />
                            <asp:BoundField DataField="UPLOAD_BY" HeaderText="上传人" />
                            <asp:BoundField DataField="UPLOAD_DATE" HeaderText="上传时间" />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="btnClose" class="btnBg" runat="server" Text="确定关闭" OnClick="btnClose_Click"  OnClientClick="return CheckNull(2);"/>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td style="font-size: 15px; color:Blue;">
                    新增处理人
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    新增处理人：<asp:TextBox ID="txtAddUsers" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Button ID="btnAddUsers" class="btnBg" runat="server" Text="新增处理人"  OnClick="btnAddUsers_Click"  OnClientClick="return CheckNull(3);"/>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <asp:HiddenField ID="hidGuid" runat="server" />
    <asp:HiddenField ID="hidRepID" runat="server" />
    <asp:HiddenField ID="hidContent" runat="server" />
        <asp:HiddenField ID="hidInnerTaskID" runat="server" />
<asp:HiddenField ID="_StartRow" runat="server" Value="0" />
    </form>
</body>
</html>
